#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

double average(vector<int>& salary) {
    sort(salary.begin(), salary.end());
    double sum = 0;
    for (int i = 1; i < salary.size() - 1; i++)  sum += salary[i];
    return sum / (salary.size() - 2);
}